﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a05
    {
		private string _modulecode;
		private string _actioncode;
		private string _usercode;
		private string _rolecode;
		
        /// <summary>
        /// 模块编码
        /// </summary>
		public string Modulecode
		{
			get { return _modulecode;	 }
			set { _modulecode=value;	}
		}
        /// <summary>
        /// 权限细则
        /// </summary>
		public string Actioncode
		{
			get { return _actioncode;	 }
			set { _actioncode=value;	}
		}
        /// <summary>
        /// 用户编码
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 组别编码
        /// </summary>
		public string Rolecode
		{
			get { return _rolecode;	 }
			set { _rolecode=value;	}
		}
		
		public static List<Sys0a05> GetSys0a05ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a05> list = new List<Sys0a05>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a05 model = GetSys0a05ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a05 GetSys0a05ByDataRow(DataRow dr)
		{
			Sys0a05 model = new Sys0a05(); //实例化Sys0a05
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("modulecode")&&!(dr["modulecode"] is System.DBNull))  
				model.Modulecode = ( string)dr["modulecode"];
			if (dcc.Contains("actioncode")&&!(dr["actioncode"] is System.DBNull))  
				model.Actioncode = ( string)dr["actioncode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("rolecode")&&!(dr["rolecode"] is System.DBNull))  
				model.Rolecode = ( string)dr["rolecode"];
			
			return model;
		}
    }
}
